package com.study.think.node_08.Study_02;

import java.util.Random;

/**
 * Created by zc on 2017/3/9.
 */
public class RandomShapeGenerator {

    private Random random = new Random(47);

    public Shape next() {
        switch (random.nextInt(3)) {
            default:;
            case 0: return new Circle();
            case 1: return new Square();
            case 2: return new Triangle();
        }
    }

}
